﻿using System;
using System.Collections.Generic;
using System.Text;
using XXX.Models.AS;
using XXX.Models.XXXEntities;
using ZDEntity;

namespace XXX.Common
{
    public class CanShu
    {
        public static readonly string conStr = Common.AppSettings.GetAppSeting("U8DB");
        public static readonly string apiEnv = Common.AppSettings.GetAppSeting("apienv");
        public static readonly string cOrg = Common.AppSettings.GetAppSeting("Org");
        //token
        public static readonly string apiuser = Common.AppSettings.GetAppSeting("apiuser");
        public static readonly string apipwd = Common.AppSettings.GetAppSeting("apipwd");

        //启用日期
        public static readonly string dBegin = Common.AppSettings.GetAppSeting("BeginDate");
        public static readonly string coUrl = Common.AppSettings.GetAppSeting("COURL");
        public static readonly string MesUrl = Common.AppSettings.GetAppSeting("MESURL");
        public static readonly string OAUrl = Common.AppSettings.GetAppSeting("OAUrl");

        public static string cServer = Common.AppSettings.GetAppSeting("ServerIP");
        public static string cUserid = Common.AppSettings.GetAppSeting("UserName");
        public static string cPassword = Common.AppSettings.GetAppSeting("UserPass");
        //部门档案基准的账套
        public static string cZT = Common.AppSettings.GetAppSeting("U8Account");

        //收发类别
        public static string Rd32Red = Common.AppSettings.GetAppSeting("Rd32Red");
        public static string Rd32 = Common.AppSettings.GetAppSeting("Rd32");
        public static string Rd11MORed = Common.AppSettings.GetAppSeting("Rd11MORed");
        /// <summary>
        /// 材料出库单收发类别编码
        /// </summary>
        public static string Rd11MO = Common.AppSettings.GetAppSeting("Rd11MO");
        /// <summary>
        /// 材料出库单默认仓库
        /// </summary>
        public static string Rd11_cWhCode = Common.AppSettings.GetAppSeting("Rd11_cWhCode");

        /// <summary>
        /// 半成品默认仓库
        /// </summary>
        public static string Rd11_cWhCode2 = Common.AppSettings.GetAppSeting("Rd11_cWhCode2");
        /// <summary>
        /// 材料出库单默认部门
        /// </summary>
        public static string Rd11_cDepCode = Common.AppSettings.GetAppSeting("Rd11_cDepCode");
        public static string Rd11OMRed = Common.AppSettings.GetAppSeting("Rd11OMRed");
        public static string Rd11OM = Common.AppSettings.GetAppSeting("Rd11OM");
        public static string Rd01Red = Common.AppSettings.GetAppSeting("Rd01Red");
        public static string Rd01 = Common.AppSettings.GetAppSeting("Rd01");
        public static string Rd10Red = Common.AppSettings.GetAppSeting("Rd10Red");
        /// <summary>
        /// 收发类别编码
        /// </summary>
        public static string Rd10 = Common.AppSettings.GetAppSeting("Rd10");
        /// <summary>
        /// 产成品入库单默认仓库
        /// </summary>
        public static string Rd10_cWhCode = Common.AppSettings.GetAppSeting("Rd10_cWhCode");

        public static string Rd08 = Common.AppSettings.GetAppSeting("Rd08");

        public static string Rd09 = Common.AppSettings.GetAppSeting("Rd09");
        public static string Rd09BaoFei = Common.AppSettings.GetAppSeting("Rd09BaoFei");
        public static string Rd09PanKui = Common.AppSettings.GetAppSeting("Rd09PanKui");
        public static string Rd08PanYing = Common.AppSettings.GetAppSeting("Rd08PanYing");
        //试产订单的默认部门,默认出库类别，入库类别
        public static string scdep = Common.AppSettings.GetAppSeting("scdep");
        public static string scRd11 = Common.AppSettings.GetAppSeting("scRd11");
        public static string scRd10 = Common.AppSettings.GetAppSeting("scRd10");
        public static string RdTV08 = Common.AppSettings.GetAppSeting("RdTV08");
        public static string RdTV09 = Common.AppSettings.GetAppSeting("RdTV09");
        //默认批次
        public static string cbatch = Common.AppSettings.GetAppSeting("cbatch");

        //是否拆分自由项，是否检查自由项
        public static string bfree1check = Common.AppSettings.GetAppSeting("bfree1check");
        public static string bfree1chai = Common.AppSettings.GetAppSeting("bfree1chai");
        /// <summary>
        /// 中间库的连接字符串，用于基础档案的存储
        /// </summary>
        public static string conStrInter = Common.AppSettings.GetAppSeting("interdata");

        public static API_Inventory invModel = Common.AppSettings.LoadInventoryJson();


        public static AS_Vendor venModel = Common.AppSettings.LoadVenJson();
        public static AS_Customer cusModel = Common.AppSettings.LoadCustomerJson();
        //是否记录co返回的xml
        public static string U8Recordlog = Common.AppSettings.GetAppSeting("U8Recordlog");

        //接口重复调用间隔
        public static int chkRepeat = int.TryParse(Common.AppSettings.GetAppSeting("chkRepeat"), out int i) ? i : 10;

        public static string token = string.Empty;
        public static DateTime tokenTm = DateTime.MinValue;


        //邮件信息
        public static MailReposity mail = AppSettings.GetSectionModel<MailReposity>("Mail");

        public static WMSPara2 wmspara = AppSettings.GetSectionModel<WMSPara2>("WMSPara");
        //MES账号信息
        public static User MESUser = AppSettings.GetSectionModel<User>("MES");


    }
}
